package com.zhengx.moduletest.di;

import com.zhengx.baselib.di.ForActivity;
import com.zhengx.moduletest.MainActivity;

import dagger.BindsInstance;
import dagger.Subcomponent;

/**
 * dagger2 app组件,所有依赖注入管理
 * 注入示例
 * 在app级别下，必须包含CFBModule和AndroidInjectionModule
 * 并且需要处理Activity和fragment的注入
 * Created by zx on 2018/4/26.
 */
@ForActivity
@Subcomponent(modules = {MainActivityModule.class})
public interface MainActivityComponent {

    FragmentComponent.Builder fragmentComponent();

    @Subcomponent.Builder
    interface Builder {
        @BindsInstance
        Builder activity(MainActivity activity);
        MainActivityComponent build();
    }
    void inject(MainActivity activity);
}
